﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ASS.BUS.DTO;
using ASS.BUS.Services;

namespace ASS
{
    public partial class FrmDonThuoc : Form
    {
        private DonThuoc donThuoc = new DonThuoc();
        public FrmDonThuoc(DonThuoc donThuoc)
        {
            InitializeComponent();
            this.donThuoc = donThuoc;
        }

        private void FrmDonThuoc_Load(object sender, EventArgs e)
        {
            ThuocServices thuocServices = new ThuocServices();
            BenhNhanServices benhNhanServices = new BenhNhanServices();
            txtNgayKham.Text = donThuoc.NgayKham;
            var patient = benhNhanServices.GetBenhNhan(donThuoc.MaBn);
            txtTenBenhNhan.Text = patient.Ten;
            txtMaBenhNhan.Text = patient.MaBn.ToString();
            rtbChuanDoan.Text = donThuoc.ChuanDoan;
            rtbGhiChu.Text = donThuoc.DanDo;
            txtNgayTaiKham.Text = donThuoc.NgayTaiKham;
            rtbThuoc.Text = donThuoc.MaThuoc;
            rtfSoLuong.Text = donThuoc.SoLuong;
            txtTenBenhNhan.Enabled = false;
            rtbGhiChu.Enabled = false;
            rtbChuanDoan.Enabled = false;
            txtNgayTaiKham.Enabled = false;
            txtNgayKham.Enabled = false;
            txtMaBenhNhan.Enabled = false;

        }

        private void txtNgayTaiKham_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnPrintf_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Không thể kết nối với máy in!");
        }

    }
}
